package demo.CardDemo;

public class SilverCard extends Card {
    public SilverCard( String cardId, String Name, String phoneNumber, double money ) {
        super(cardId, Name, phoneNumber, money);
    }

    @Override
    public void consume( double money ) {
        System.out.println("使用银卡消费" + money);
        System.out.println("使用银卡优惠后金额：" + money * 0.9);
        if (getMoney() < money * 0.9) {
            System.out.println("当前余额：" + getMoney() + "余额不足，请充值");
            return;
        } else {
            setMoney(getMoney() - money * 0.9);
        }
    }

    @Override
    public void preStore( double money ) {
        System.out.println("使用银卡储值" + money);
        super.preStore(money);
    }
}
